package com.example.server.service.impl;

import com.example.server.entity.Vocabulary;
import com.example.server.mapper.VocabularyMapper;
import com.example.server.service.VocabularyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VocabularyServiceImpl implements VocabularyService {

    @Autowired
    private VocabularyMapper vocabularyMapper;

    @Override
    public List<Vocabulary> getAllVocabulary() {
        List<Vocabulary> vocabularyList = vocabularyMapper.getAllVocabulary();
        //vocabularyList.forEach(v -> System.out.println("Fetched Vocabulary: " + v.getWord() + " - " + v.getExplanation()));
        return vocabularyList;
    }
}
